#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
class Solution {
public:
    int missingNumber(vector<int>& nums) {
		/*int thesum = 0;
		for(int i=0;i<nums.size();++i)
		{
			thesum += i - nums[i];
		}
		return thesum += nums.size();*/
		if (nums.size() == 0)
			return 1 - nums[0];
		return (0 + nums.size())*(nums.size() + 1) / 2 - accumulate(nums.begin(), nums.end(), 0, [&](int a, int b) {return a + b; });
    }
};
int main()
{
	cout << Solution().missingNumber(vector<int>{ 0,3,2 }) << endl;
	
}